package it.poste.il.compensatore.service.impl;

import it.poste.il.compensatore.dao.MessageBodyDao;
import it.poste.il.compensatore.entities.MessageBody;
import it.poste.il.compensatore.service.MessageBodyService;

import java.util.List;

import org.springframework.stereotype.Service;

/**
 * Implementation of MessageBodyService.
 */
@Service("messageBodyService")
public class MessageBodyServiceImpl implements MessageBodyService {
	
	MessageBodyDao messageBodyDao;

	/**
	 * Take the message body dao.
	 * @return MessageBodyDao The message body dao.
	 */
	public MessageBodyDao getMessageBodyDao() {
		return messageBodyDao;
	}

	/**
	 * Set the message body dao.
	 * @param messageBodyDao The message body dao to set.
	 * @return void
	 */
	public void setMessageBodyDao(MessageBodyDao messageBodyDao) {
		this.messageBodyDao = messageBodyDao;
	}

	/**
	 * Method that retrieve the message body by id.
	 * @param id Id to identify the message body.
	 * @return MessageBody The entity Message Body.
	 */
	public MessageBody retrieveByID(Long id) {
		return messageBodyDao.loadById(id);
	}

	/**
	 * The list of all message body.
	 * @return List The list of Message Body.
	 */
	public List<MessageBody> retrieveAll() {
		return messageBodyDao.loadAll();
	}

	/**
	 * Method that save the message body.
	 * @param messageBody Message body to save.
	 * @return MessageBody The Message Body saved.
	 */
	public MessageBody save(MessageBody messageBody) {
		return messageBodyDao.save(messageBody);
	}

	/**
	 * Update the message body.
	 * @param messageBody Message body to update.
	 * @return void
	 */
	public void update(MessageBody messageBody) {
		messageBodyDao.update(messageBody);
	}

	/**
	 * Delete the message body.
	 * @param messageBody Message body to delete.
	 * @return void
	 */
	public void delete(MessageBody messageBody) {
		messageBodyDao.delete(messageBody);
	}
	
}
